/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pkl53.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author HP G42 (RILLA)
 */
@Entity
@Table(name = "2b2_umumusaha")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "B2Umumusaha.findAll", query = "SELECT b FROM B2Umumusaha b"),
    @NamedQuery(name = "B2Umumusaha.findByKks", query = "SELECT b FROM B2Umumusaha b WHERE b.kks = :kks"),
    @NamedQuery(name = "B2Umumusaha.findByKKSArt", query = "SELECT b FROM B2Umumusaha b WHERE b.kKSArt = :kKSArt"),
    @NamedQuery(name = "B2Umumusaha.findByB2r4", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r4 = :b2r4"),
    @NamedQuery(name = "B2Umumusaha.findByB2r5", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r5 = :b2r5"),
    @NamedQuery(name = "B2Umumusaha.findByB2r6", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r6 = :b2r6"),
    @NamedQuery(name = "B2Umumusaha.findByB2r8", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r8 = :b2r8"),
    @NamedQuery(name = "B2Umumusaha.findByB2r10", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r10 = :b2r10"),
    @NamedQuery(name = "B2Umumusaha.findByB2r15", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r15 = :b2r15"),
    @NamedQuery(name = "B2Umumusaha.findByB2r16", query = "SELECT b FROM B2Umumusaha b WHERE b.b2r16 = :b2r16")})
public class B2Umumusaha implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "KKS")
    private String kks;
    @Id
    @Basic(optional = false)
    @Column(name = "KKSArt")
    private String kKSArt;
    @Column(name = "B2R4")
    private Integer b2r4;
    @Column(name = "B2R5")
    private String b2r5;
    @Column(name = "B2R6")
    private String b2r6;
    @Column(name = "B2R8")
    private String b2r8;
    @Column(name = "B2R10")
    private Integer b2r10;
    @Column(name = "B2R15")
    private Integer b2r15;
    @Column(name = "B2R16")
    private Integer b2r16;
    @JoinColumn(name = "KKSArt", referencedColumnName = "KKSArt", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private B2Art b2Art;
    @JoinColumn(name = "B2R14", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaDalamprosesTidakTidaktahu b2r14;
    @JoinColumn(name = "B2R13", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaDalamprosesTidakTidaktahu b2r13;
    @JoinColumn(name = "B2R12", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaDalamprosesTidakTidaktahu b2r12;
    @JoinColumn(name = "B2R11", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaDalamprosesTidakTidaktahu b2r11;
    @JoinColumn(name = "B2R9", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaTidakTidaktau b2r9;
    @JoinColumn(name = "B2R7", referencedColumnName = "kode")
    @ManyToOne
    private OpsiYaTidakTidaktau b2r7;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "kKSArt")
    private List<B3Rinciusaha> b3RinciusahaList;

    public B2Umumusaha() {
    }

    public B2Umumusaha(String kKSArt) {
        this.kKSArt = kKSArt;
    }

    public B2Umumusaha(String kKSArt, String kks) {
        this.kKSArt = kKSArt;
        this.kks = kks;
    }

    public String getKks() {
        return kks;
    }

    public void setKks(String kks) {
        this.kks = kks;
    }

    public String getKKSArt() {
        return kKSArt;
    }

    public void setKKSArt(String kKSArt) {
        this.kKSArt = kKSArt;
    }

    public Integer getB2r4() {
        return b2r4;
    }

    public void setB2r4(Integer b2r4) {
        this.b2r4 = b2r4;
    }

    public String getB2r5() {
        return b2r5;
    }

    public void setB2r5(String b2r5) {
        this.b2r5 = b2r5;
    }

    public String getB2r6() {
        return b2r6;
    }

    public void setB2r6(String b2r6) {
        this.b2r6 = b2r6;
    }

    public String getB2r8() {
        return b2r8;
    }

    public void setB2r8(String b2r8) {
        this.b2r8 = b2r8;
    }

    public Integer getB2r10() {
        return b2r10;
    }

    public void setB2r10(Integer b2r10) {
        this.b2r10 = b2r10;
    }

    public Integer getB2r15() {
        return b2r15;
    }

    public void setB2r15(Integer b2r15) {
        this.b2r15 = b2r15;
    }

    public Integer getB2r16() {
        return b2r16;
    }

    public void setB2r16(Integer b2r16) {
        this.b2r16 = b2r16;
    }

    public B2Art getB2Art() {
        return b2Art;
    }

    public void setB2Art(B2Art b2Art) {
        this.b2Art = b2Art;
    }

    public OpsiYaDalamprosesTidakTidaktahu getB2r14() {
        return b2r14;
    }

    public void setB2r14(OpsiYaDalamprosesTidakTidaktahu b2r14) {
        this.b2r14 = b2r14;
    }

    public OpsiYaDalamprosesTidakTidaktahu getB2r13() {
        return b2r13;
    }

    public void setB2r13(OpsiYaDalamprosesTidakTidaktahu b2r13) {
        this.b2r13 = b2r13;
    }

    public OpsiYaDalamprosesTidakTidaktahu getB2r12() {
        return b2r12;
    }

    public void setB2r12(OpsiYaDalamprosesTidakTidaktahu b2r12) {
        this.b2r12 = b2r12;
    }

    public OpsiYaDalamprosesTidakTidaktahu getB2r11() {
        return b2r11;
    }

    public void setB2r11(OpsiYaDalamprosesTidakTidaktahu b2r11) {
        this.b2r11 = b2r11;
    }

    public OpsiYaTidakTidaktau getB2r9() {
        return b2r9;
    }

    public void setB2r9(OpsiYaTidakTidaktau b2r9) {
        this.b2r9 = b2r9;
    }

    public OpsiYaTidakTidaktau getB2r7() {
        return b2r7;
    }

    public void setB2r7(OpsiYaTidakTidaktau b2r7) {
        this.b2r7 = b2r7;
    }

    @XmlTransient
    public List<B3Rinciusaha> getB3RinciusahaList() {
        return b3RinciusahaList;
    }

    public void setB3RinciusahaList(List<B3Rinciusaha> b3RinciusahaList) {
        this.b3RinciusahaList = b3RinciusahaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kKSArt != null ? kKSArt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof B2Umumusaha)) {
            return false;
        }
        B2Umumusaha other = (B2Umumusaha) object;
        if ((this.kKSArt == null && other.kKSArt != null) || (this.kKSArt != null && !this.kKSArt.equals(other.kKSArt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pkl53.model.B2Umumusaha[ kKSArt=" + kKSArt + " ]";
    }
    
}
